package com.qianfeng.vhly.youshare.tasks;

import android.os.AsyncTask;
import com.qianfeng.vhly.youshare.utils.HttpTool;

import java.io.UnsupportedEncodingException;

/**
 * Created with IntelliJ IDEA.
 * User: vhly[FR]
 * Date: 15/2/5
 * Email: vhly@163.com
 */
public class ProductListTask extends AsyncTask<String, Integer, String> {

    @Override
    protected String doInBackground(String... params) {
        String ret = null;
        if (params != null && params.length > 0) {
            String id = params[0];
            String url = "http://open.doushangshang.com/category.php?id=" + id;
            byte[] bytes = HttpTool.get(url);
            if (bytes != null) {
                try {
                    ret = new String(bytes, "UTF-8");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            }
        }
        return ret;
    }
}
